
#region Imports

using System;
using System.Collections.Generic;

#endregion

namespace Justa.Data
{
    /// <summary>
    /// 
    /// </summary>
    /// 
    /// <typeparam name="E"></typeparam>
    /// 
    /// <author>Abel Perez (java.aperez@gmail.com)</author>
    /// 
    public class DataAccessEventArgs<E> : EventArgs
    {
        /// <summary>
        /// 
        /// </summary>
        /// 
        private E entity;

        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <param name="entity"></param>
        /// 
        public DataAccessEventArgs(E entity)
        {
            this.entity = entity;
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        public E Entity
        {
            get
            {
                return entity;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <returns></returns>
        /// 
        public override string ToString()
        {
            if (entity == null)
            {
                return base.ToString();
            }

            return string.Format("Data Access Event for Entity = {0}.", entity.GetType().Name);
        }
    }
}
